#define _CRT_SECURE_NO_WARNINGS 1
class Solution {
public:
    vector<int> twoSum(vector<int>& nums, int target) {
        unordered_map<int, int> hashi;
        for (int i = 0; i < nums.size(); i++) {
            hashi.insert({ nums[i], i });
        }
        for (int i = 0; i < nums.size(); ++i) {
            int x = target - nums[i];
            if (hashi.count(x) && hashi[x] != i)
                return { hashi[x], i };
        }
        return {};
    }
};